<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: RssController</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">RssController</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/app/controllers/rss_controller_rb.html">
                app/controllers/rss_controller.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="ApplicationController.html">
                ApplicationController
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000015">make</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000015" class="method-detail">
        <a name="M000015"></a>

        <div class="method-heading">
          <a href="#M000015" class="method-signature">
          <span class="method-name">make</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000015-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/rss_controller.rb, line 3</span>
 3:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make</span>
 4:     <span class="ruby-identifier">string</span> =<span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
 5:     <span class="ruby-identifier">results</span>=<span class="ruby-constant">Swarm</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>,<span class="ruby-identifier">:conditions=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;public = 1&quot;</span>,<span class="ruby-identifier">:limit=</span><span class="ruby-operator">&gt;</span><span class="ruby-value">20</span>,<span class="ruby-identifier">:order=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;id&quot;</span>)
 6:     <span class="ruby-identifier">xm</span>=<span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:target=</span><span class="ruby-operator">&gt;</span><span class="ruby-identifier">string</span>)
 7:     <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">instruct!</span>
 8:     <span class="ruby-identifier">string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;rss version=\&quot;2.0\&quot;&gt;&quot;</span>
 9:     <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">channel</span>{
10:       <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">title</span>(<span class="ruby-value str">&quot;dragons swarms&quot;</span>)
11:       <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">link</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">protocol</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">host_with_port</span>)
12:       <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">description</span>(<span class="ruby-value str">&quot;one p2p system&quot;</span>)
13:       <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">language</span>(<span class="ruby-value str">&quot;en-US&quot;</span>)
14:       <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">copyright</span>(<span class="ruby-value str">&quot;Copyright 2006, enzzy &quot;</span>)
15:       <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">category</span>(<span class="ruby-value str">&quot;p2p source&quot;</span>)
16:       <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">webmaster</span>(<span class="ruby-value str">&quot;zhu1230@gmail.com&quot;</span>)
17:       <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">image</span>{
18:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">url</span>(<span class="ruby-value str">&quot;../logo.gif&quot;</span>)
19:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">title</span>(<span class="ruby-value str">&quot;logo gif&quot;</span>)
20:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">link</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">protocol</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">host_with_port</span>)
21:       }
22:       <span class="ruby-identifier">results</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
23:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">item</span>{
24:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">title</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">title</span>)
25:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">description</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">description</span>)
26:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">link</span>(<span class="ruby-identifier">url_for</span>(<span class="ruby-identifier">:controller=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;swarm&quot;</span>,<span class="ruby-identifier">:action=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;show_one&quot;</span>,<span class="ruby-identifier">:id=</span><span class="ruby-operator">&gt;</span><span class="ruby-identifier">r</span>.<span class="ruby-identifier">url</span>))
27:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">author</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">contact_info</span>)
28:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">category</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">catelog</span>.<span class="ruby-identifier">title</span>)
29:         <span class="ruby-identifier">xm</span>.<span class="ruby-identifier">pubDate</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">creation_time</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%a,%d %b %y %H:%M:%S GMT&quot;</span>))
30: 
31:         }
32:       }
33:     }
34:     
35:     <span class="ruby-identifier">string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;/rss&gt;&quot;</span>
36:     
37:     <span class="ruby-ivar">@content</span>=<span class="ruby-identifier">string</span>
38:     <span class="ruby-ivar">@content_type</span>=<span class="ruby-value str">'text/xml'</span>
39:   <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-value str">&quot;Content-Type&quot;</span>] = <span class="ruby-ivar">@content_type</span>
40:     <span class="ruby-identifier">render</span> <span class="ruby-identifier">:layout=</span><span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>
41:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>